//
//  StrategyOtherTableViewCell.m
//  ErWa
//
//  Created by 王阳阳 on 16/3/11.
//  Copyright © 2016年 www.lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "StrategyOtherTableViewCell.h"
@implementation StrategyOtherTableViewCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.userImgview = [[UIImageView alloc] init];
        [self.contentView addSubview:_userImgview];
        
        self.userNameLabel = [[UILabel alloc] init];
        [self.contentView addSubview:_userNameLabel];
        
        self.imgView = [[UIImageView alloc] init];
        _imgView.contentMode = UIViewContentModeScaleAspectFill;
        _imgView.clipsToBounds = YES;
        [self.contentView addSubview:_imgView];
        
        self.contentLabel = [[UILabel alloc] init];
        [self.contentView addSubview:_contentLabel];
    }
    return self;
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    //头像
    self.userImgview.frame = CGRectMake(5, 5, self.contentView.frame.size.height / 8, self.contentView.frame.size.height / 8);
    _userImgview.layer.cornerRadius = _userImgview.frame.size.width / 2;
    _userImgview.clipsToBounds = YES;
    //名字
    self.userNameLabel.frame = CGRectMake(10 + _userImgview.frame.size.width, 5, self.contentView.frame.size.width - 15 - _userImgview.frame.size.width, _userImgview.frame.size.height);
    //内容
    self.contentLabel.frame = CGRectMake(5, _userImgview.frame.origin.y + _userImgview.frame.size.height + 5, self.contentView.frame.size.width - 5, self.contentView.frame.size.height / 5);
    _contentLabel.font = [UIFont systemFontOfSize:14];//字体
    _contentLabel.numberOfLines = 0;//不限制行高
    //图片
    self.imgView.frame = CGRectMake(10, _contentLabel.frame.origin.y + _contentLabel.frame.size.height + 5, self.contentView.frame.size.width - 20, self.contentView.frame.size.height - 20 - self.contentView.frame.size.height / 6 - self.contentView.frame.size.height / 5);
    //边框颜色
    _imgView.layer.borderColor = [UIColor colorWithRed:255/255. green:228/255. blue:225/255. alpha:.8].CGColor;
    _imgView.layer.borderWidth = 10;//边框粗细
    _imgView.layer.cornerRadius = 5;//圆角
    _imgView.clipsToBounds = YES;
    _imgView.userInteractionEnabled = YES;
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
